package net.huosen.blog.service.impl;

import javax.annotation.Resource;

import net.huosen.blog.dao.IUserDao;
import net.huosen.blog.model.User;
import net.huosen.blog.service.IUserService;

import org.springframework.stereotype.Component;
/*
 * Service层
 */
@Component("userService")
public class UserServiceImpl implements IUserService {
	
	@Resource(name="userDao")
	private IUserDao dao;

	@Override
	public User login(User user) {
		User newUser = dao.queryUserByName(user.getName());
		if(newUser == null){
			//用户名不存在！
		}else{
			if(newUser.getPassword().equals(user.getPassword())){
				//登录成功
				return newUser;
			}else{
				//密码不正确
			}
		}
		return null;
	}
	
}
